🌴KapoeiraπŸ•ΊπŸ’ƒ

kapoeira

Tests d’intΓ©gration dans un environnement Kafka

Sommaire

  • Kapoeira

  • Syntaxe

  • DΓ©mo

Kapoeira

Story Telling

  • C’est quoi

    • outil TI Kafka

  • Pourquoi

    • tests topo driver insuffisants, pas d’outil sur le marchΓ©, QA pas outillΓ©

    • on recherche un outil pour communiquer en DEV/QA/PO

  • Histoire

    • Inspiration Karate (et Gherkin)

    • Naissance en 2020 (1ere implem naive, basΓ© sur console-script confluent)

    • Utilisation de ZIO dΓ¨s 202x (pour amΓ©loration perf)

  • Explication syntaxe

    • Simple d’utilisation et utilisable par tous

  • Utilisation

  • DΓ©mo

  • REX Kapo dans notre quotidien

    • Niveau d’adoption

    • Utilisation dΓ¨s spec pour test d’acceptance

    • FacilitΓ© d’enrichissement de test apres les DEV

    • DΓ©finition de tests End2End

  • Contribution

Tests d’intΓ©gration dans un environnement Kafka

kapoeira

Les origines…​

  • Contexte Lectra

  • Inner Source puis OpenSource

Syntaxe

TODO

DΓ©mo

buger quiz

Architecture

burger quiz

Docker commands

docker compose build --no-cache
docker compose up -d
docker restart kapoeira

burger.feature

Feature: Burger πŸ” feature

  Background:
    Given input topic
      | topic     | alias        | key_type | value_type |
      | bread     | bread-in     | string   | string     |
      | vegetable | vegetable-in | string   | string     |
      | meat      | meat-in      | string   | string     |
    And output topic
      | topic  | alias      | key_type | value_type | readTimeoutInSecond |
      | burger | burger-out | string   | string     | 5                   |
    And var uuid = call function: uuid

  Scenario: Nominal
    When records with key and value are sent
      | topic_alias  | key        | value |
      | bread-in     | 🀀_${uuid} | 🍞    |
      | vegetable-in | 🀀_${uuid} | πŸ…    |
      | meat-in      | 🀀_${uuid} | πŸ₯©    |
    Then expected records
      | topic_alias | key        | value |
      | burger-out  | 🀀_${uuid} | order |
    And assert order $ == "πŸ”"

  Scenario: Not a burger
    When records with key and value are sent
      | topic_alias  | key        | value |
      | bread-in     | 🀀_${uuid} | 🍞    |
      | vegetable-in | 🀀_${uuid} | πŸ₯•    |
      | meat-in      | 🀀_${uuid} | πŸ₯©    |
    Then expected records
      | topic_alias | key        | value |
      | burger-out  | 🀀_${uuid} | order |
    And assert order $ == "🍞 + πŸ₯• + πŸ₯©"

  Scenario Outline: Many customers
    When records with key and value are sent
      | topic_alias  | key            | value       |
      | bread-in     | <user>_${uuid} | <bread>     |
      | vegetable-in | <user>_${uuid} | <vegetable> |
      | meat-in      | <user>_${uuid} | <meat>      |
    Then expected records
      | topic_alias | key            | value |
      | burger-out  | <user>_${uuid} | order |
    And assert order $ == "<result>"

    Examples:
      | user | bread | vegetable | meat | result |
      | 🀀   | 🍞    | πŸ…        | πŸ₯©   | πŸ”     |
      | πŸ˜‹   | 🍞    | πŸ…        | πŸ—   | πŸ”     |
      | 😑   | 🍞    | πŸ…        | 🐟   | πŸ”     |

meal.feature

Feature: Meal πŸ› feature

  Background:
    Given input topic
      | topic       | alias          | key_type | value_type |
      | bread       | bread-in       | string   | string     |
      | vegetable   | vegetable-in   | string   | string     |
      | meat        | meat-in        | string   | string     |
      | side-dishes | side-dishes-in | string   | string     |
    And output topic
      | topic | alias    | key_type | value_type | readTimeoutInSecond |
      | meal  | meal-out | string   | string     | 20                  |
    And var uuid = call function: uuid

  Scenario: Left Join with Left first
    When records with key and value are sent
      | topic_alias    | key        | value |
      | bread-in       | 🀀_${uuid} | 🍞    |
      | vegetable-in   | 🀀_${uuid} | πŸ…    |
      | meat-in        | 🀀_${uuid} | πŸ₯©    |
      | side-dishes-in | 🀀_${uuid} | πŸ₯”πŸΊ  |
    Then expected records
      | topic_alias | key        | value |
      | meal-out    | 🀀_${uuid} | notif |
      | meal-out    | 🀀_${uuid} | order |
    And assert notif $ == "πŸ”"
    And assert order $ == "πŸ›(πŸ” + 🍟🍺)"

  Scenario: Left Join with Right first
    When records with key and value are sent
      | topic_alias    | key        | value |
      | side-dishes-in | 🀀_${uuid} | πŸ₯”πŸ·  |
      | bread-in       | 🀀_${uuid} | 🍞    |
      | vegetable-in   | 🀀_${uuid} | πŸ…    |
      | meat-in        | 🀀_${uuid} | πŸ₯©    |
    Then expected records
      | topic_alias | key        | value |
      | meal-out    | 🀀_${uuid} | order |
    And assert order $ == "πŸ›(πŸ” + 🍟🍷)"